package net.lucamasini.ricette.model;

import javax.persistence.Entity;
import javax.persistence.Version;
import javax.xml.bind.annotation.XmlRootElement;

import net.lucamasini.ricette.server.ActiveRecord;

@Entity
@XmlRootElement(name = "ingredientiRicetta")
public class IngredientiRicetta extends ActiveRecord {

	private static final long serialVersionUID = 1L;

    @Version
    private Integer version;

    private String keyIngrediente;
	
	private String quantita;

	public IngredientiRicetta() {
		super();
	}

	public IngredientiRicetta(String keyIngrediente) {
		this.keyIngrediente = keyIngrediente;
	}

	public IngredientiRicetta(String keyIngrediente, String quantita) {
		this.keyIngrediente = keyIngrediente;
		this.quantita = quantita;
	}

	public Integer getVersion() {
		return version;
	}

	public void setVersion(Integer version) {
		this.version = version;
	}

	public String getKeyIngrediente() {
		return keyIngrediente;
	}

	public void setKeyIngrediente(String keyIngrediente) {
		this.keyIngrediente = keyIngrediente;
	}

	public String getQuantita() {
		return quantita;
	}

	public void setQuantita(String quantita) {
		this.quantita = quantita;
	}
	
	public static IngredientiRicetta findIngredientiRicetta(String id) {
		return find(IngredientiRicetta.class, id);
	}
}
